package com.study.hot.jetpack.demo_shopping.fragment

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import androidx.fragment.app.Fragment
import com.study.hot.R
import com.study.hot.databinding.LoginFragmentBinding
import com.study.hot.jetpack.demo_shopping.viewmodel.LoginModel

/**
 * <pre>
 *     author : fauks
 *     time   : 2020/03/25
 *     desc   :
 * </pre>
 */
class LoginFragment : Fragment() {

    lateinit var loginModel: LoginModel

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        val loginBinding = DataBindingUtil.inflate<LoginFragmentBinding>(inflater, R.layout.login_fragment, container, false)
        loginModel = LoginModel("", "", requireContext())
        loginBinding.model = loginModel
        loginBinding.context = activity
        return loginBinding.root
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        //获取参数
        /*arguments?.apply {
            val name = getString("name")
            et_account.setText(name)
        }*/
    }
}